package com.xing.ui.expandableRecyclerView

import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView

class ExpandableRecyclerAdapter(val mList: MutableList<ExpandableData>): RecyclerView.Adapter<ExpandableGroupVH>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ExpandableGroupVH {
        return ExpandableGroupVH(TextView(parent.context))
    }

    override fun onBindViewHolder(holder: ExpandableGroupVH, position: Int) {
        holder.bind(mList[holder.adapterPosition])
    }

    override fun getItemCount(): Int {
        return mList.size
    }

}